package com.example.forecast.Juhe;

import java.util.Random;

public class URLUtils {
    public static final Random random = new Random();
    public static final String  KEY1 = "348fa4890bfe12918fb8780739fcf158";
    public static final String  KEY2 = "9df29f861d52ad25ccef50a062b5a8e0";
    public static final String[] key = {KEY1,KEY2};
    public static final String KEY = key[random.nextInt(key.length)];

    public static String temp_url = "http://apis.juhe.cn/simpleWeather/query";

    public static String index_url = "http://apis.juhe.cn/simpleWeather/life";

    public static String weather_url = "http://apis.juhe.cn/simpleWeather/wids?key=";

    public static String getTemp_url(String city){
        String url = temp_url+"?city="+city+"&key="+KEY;
        return url;
    }

    public static String getIndex_url(String city){
        String url = index_url+"?city="+city+"&key="+KEY;
        return url;
    }

    public static String getWeather_url(){
        String url = weather_url+KEY;
        return url;
    }
}

